import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/save',
    method: 'post',
    data: row
  })
}

//查看
export const detail = (id) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 上传用户信息接口
export const changeUserInfo = (data) => {
  return request({
    url: '/api/blade-user/update',
    method: 'post',
    data: data
  })
}
// 申请评审
export const applyReview = (ids) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/submit',
    method: 'get',
    params: {
      ids,
    }
  })
}
// 获取物料组
export const materialGroupList = () => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/materialGroupList',
    method: 'get'
  })
}
// 获取供应商编码
export const generateSupplierNo = ()=> {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/generateSupplierNo',
    method: 'get'
  })
}
// 保存联系人
export const saveUserInfo = (data) => {
  return request({
    url: '/api/blade-user/submitUser',
    method: 'post',
    data: data
  })
}
// 删除联系人
export const removeConnect = (id) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/deleteUser',
    method: 'post',
    params: {
      id,
    }
  })
}

// 获取银行名称
export const getBankNameFromCount = (cardNo) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/getCardDetail',
    method: 'get',
    params: {
      cardNo,
    }
  })
}